package com.jet.merchant.gate;

import com.jet.core.result.ResultJson;
import com.jet.merchant.domain.vo.RegionTreeVo;
import com.jet.merchant.service.IMerchantRegionService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/gate/region")
public class GateRegionController {

    private final IMerchantRegionService merchantRegionService;

    public GateRegionController(IMerchantRegionService merchantRegionService) {
        this.merchantRegionService = merchantRegionService;
    }

    @GetMapping("/list")
    public ResultJson<List<RegionTreeVo>> getList() {
        return ResultJson.ok(merchantRegionService.findAll());
    }
}
